package com.lanchewuyou.user.driver.yancheui;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;

import com.lanchewuyou.user.driver.R;
import com.lanchewuyou.user.driver.layouts.YancheFinishDialog;
import com.lanchewuyou.user.driver.modul.Config;

/**
 * 验车还车结束界面
 */
public class YancheReturnOverActivity extends AppCompatActivity implements View.OnClickListener {

    private ImageButton yancheReturnOverBack;
    private Button yancheReturnOverTel, yancheReturnOverNext;
    private YancheFinishDialog.Builder builder;
    private static String DRIVERID;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_yanche_return_over);
        SharedPreferences sharedPreferences = getSharedPreferences(Config.PASSWORD_PATH, Activity.MODE_PRIVATE);
        DRIVERID = sharedPreferences.getString("driverid", "");
        initViews();
    }

    private void initViews() {
        yancheReturnOverBack = (ImageButton) findViewById(R.id.yanche_return_over_back);
        yancheReturnOverBack.setOnClickListener(this);
        yancheReturnOverTel = (Button) findViewById(R.id.yanche_return_over_tel_btn);
        yancheReturnOverTel.setOnClickListener(this);
        yancheReturnOverNext = (Button) findViewById(R.id.yanche_return_over_next_btn);
        yancheReturnOverNext.setOnClickListener(this);
        builder = new YancheFinishDialog.Builder(this).setMessage("您已成功提交行驶路线").setPositiveButton("确定", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                dialog.dismiss();
            }
        });

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.yanche_return_over_back:

                break;
            case R.id.yanche_return_over_tel_btn:

                break;
            case R.id.yanche_return_over_next_btn:
                builder.create().show();
                break;
            default:
                break;
        }
    }
}
